package blog.exception;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;

@Data
public class ModelException extends Exception {
    @Autowired
    private Model model;
    public ModelException(Model model){
        this.model = model;
    }
    public ModelException(String errorMsg){
        model.addAttribute("errorMsg", errorMsg);
    }
}
